<?php include('head_view.php') ?>

<h1><?php echo $heading; ?></h1><?php echo anchor('usuario/create', 'Novo');?><hr>

      <table width="100%" border="1">
          <tr>
              <th>Avatar</th>
              <th>Nome</th>
              <th>Username</th>
              <th>E-mail</th>
              <th>Ações</th>
          </tr>

       <?php foreach ($query as $row): ?>
          <tr align="center">
            <td>
                <?php if($row->avatar) {?>
                    <img src="<?php echo base_url();?>upload/<?php echo $row->avatar;?>" alt="Avatar" width="80" height="80">
                <?php }else{?>
                    <img src="<?php echo base_url();?>img/default_avatar.gif" alt="Avatar" width="80" height="80">
                <?php } ?>
            </td>
            <td><?php echo $row->nome; ?></td>
            <td><?php echo $row->username; ?></td>
            <td><?php echo $row->email; ?></td>
            <td>
                <?php echo anchor('usuario/timelineVisitanteView/' . $row->idUsuario, 'Perfil');?> |
                <?php echo anchor('usuario/editar/' . $row->idUsuario, 'Alterar');?> |
                <?php echo anchor('usuario/delete/' . $row->idUsuario, 'Excluir', array('onclick'=>"return confirma()"));?>
            </td>
          </tr>
       <?php endforeach;?>
      </table>

<hr>
 <?php include('footer_view.php') ?>